package com.jmye.mybatis.mapper;

import com.jmye.mybatis.entity.Role;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description
 * @Date 2024/11/27 下午9:41
 * @Author jmye
 */
public interface RoleMapper {
    @Select("select r.id,r.role_name from role r,user_role ur where r.id=ur.role_id and ur.user_id=#{uid}")
    @Results({
            @Result(id = true, column = "id", property = "id"),
            @Result(column = "role_name", property = "roleName")
    })
    List<Role> findByUid(Integer uid);
}
